package com.paomi.client.activity.person.presenter;

import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
import com.paomi.client.activity.person.View.MyOrderNumView;
import com.paomi.client.activity.person.model.MyOrderNumBean;
import com.paomi.client.net.Api;
import com.paomi.client.net.BaseCallback;
import com.paomi.client.net.Constants;

import retrofit2.Call;

/**
 * 我的订单页面
 */
public class MyOrderPre extends MvpBasePresenter<MyOrderNumView> {
    /**
     * 订单数量的介绍
     */
    public void getNumOrder(String state){
        Api.getInstanceService(Constants.Ticket_URL).myOrderTotal(state).enqueue(new BaseCallback<MyOrderNumBean>() {
            @Override
            public void onResponse(Call<MyOrderNumBean> call, MyOrderNumBean result) {
                if(isViewAttached()){
                    getView().setNumData(result);
                }
            }
        });
    }
}
